<?php
class Application_Model_Visiteur{ 
    protected $_id;
    protected $_id_celibataire;
    protected $_id_visiteur;
    protected $_date;

    
    public function __construct(array $options = null)
    {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }

    public function __set($name, $value)
    {
        $method = 'set' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid Visiteur property');
        }
        $this->$method($value);
    }

    public function __get($name)
    {
        $method = 'get' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid Visiteur property');
        }
        return $this->$method();
    }

    public function setOptions(array $options)
    {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }

    public function setId($id)
    {
        $this->_id =  $id;
        return $this;
    }

    public function getId()
    {
        return $this->_id;
    }
    
    public function setIdCelibataire($text)
    {
        $this->_id_celibataire = (string) $text;
        return $this;
    }

    public function getIdCelibataire()
    {
        return $this->_id_celibataire;
    }

    public function setIdVisiteur($email)
    {
        $this->_id_visiteur = (string) $email;
        return $this;
    }

    public function getIdVisiteur()
    {
        return $this->_id_visiteur;
    }

    public function setDate($ts)
    {
        $this->_date = $ts;
        return $this;
    }

    public function getDate()
    {
        return $this->_date;
    }
    

}